﻿namespace WebApi.Demo
{
    public class TestBackgroudService : BackgroundService
    {
        private readonly IConfiguration _configuration;
        public TestBackgroudService(IConfiguration configuration)
        {
            _configuration = configuration;
        }
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            while (!stoppingToken.IsCancellationRequested)
            {
                await Task.Delay(1000);
                Console.WriteLine(_configuration["AAA:A1"]);
            }
        }
    }
}
